package store.util;


import org.apache.log4j.Logger;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import store.service.IService;

import java.awt.*;

public abstract class AppUtils {
    private static final Logger LOGGER = Logger.getLogger(AppUtils.class);
    public static final ApplicationContext APP_CONTEXT = new ClassPathXmlApplicationContext("classpath:spring-config.xml");

    public static IService getService(String serviceName) {
        return APP_CONTEXT.getBean(serviceName, IService.class);
    }

    public static Dimension getScreenSize() {
        return Toolkit.getDefaultToolkit().getScreenSize();
    }


}
